package com.zwj.batch.config.springBatch.listener.step;

import com.zwj.batch.core.ResouceCount;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;

/**
 * @author 张文接
 * @version 1.0
 * @createTime 2023-06-25 14:41:00
 */
public class MyStepListener2 implements StepExecutionListener {
    @Override
    public void beforeStep(StepExecution stepExecution) {
    }

    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        if (ResouceCount.TOTAL_COUNT != ResouceCount.READ_COUNT) {
            return ExitStatus.STOPPED;
        }
        return stepExecution.getExitStatus();
    }
}
